package Day26.java.deom02;

import com.google.gson.Gson;

public class Demo01 {
    public static void main(String[] args) {
        //  创建Gson对象
        Gson g = new Gson();
        //  转换
        Book b = new Book("金苹果", "100", "种植苹果真辛苦");
        String s = g.toJson(b);
        System.out.println(s);
        //{"name":"金苹果","id":"100","info":"种植苹果真辛苦"}
    }
}
